using System;
using System.Collections;
using Rdl;

namespace GTame.ReportParser
{

    public class ListType
    {

        private ActionType _Action;
        private string _Bookmark;
        private CustomPropertiesType _CustomProperties;
        private string _DataElementName;
        private ListTypeDataElementOutput _DataElementOutput;
        private ListTypeDataInstanceElementOutput _DataInstanceElementOutput;
        private string _DataInstanceName;
        private string _DataSetName;
        private Nullable<bool> _FillPage;
        private FiltersType _Filters;
        private GroupingType _Grouping;
        private string _Height;
        private Nullable<bool> _KeepTogether;
        private string _Label;
        private string _Left;
        private string _LinkToChild;
        private string _NoRows;
        private Nullable<bool> _PageBreakAtEnd;
        private Nullable<bool> _PageBreakAtStart;
        private string _RepeatWith;
        private ReportItemsTypeComposite _ReportItems;
        private SortingType _Sorting;
        private StyleType _Style;
        private string _ToolTip;
        private string _Top;
        private VisibilityType _Visibility;
        private string _Width;
        private Nullable<uint> _ZIndex;
        private string nameField;

        public ActionType Action
        {
            get
            {
                if (_Action == null)
                    _Action = new ActionType();
                return _Action;
            }
            set
            {
                _Action = value;
            }
        }

        public string Bookmark
        {
            get
            {
                return _Bookmark;
            }
            set
            {
                _Bookmark = value;
            }
        }

        public CustomPropertiesType CustomProperties
        {
            get
            {
                if (_CustomProperties == null)
                    _CustomProperties = new CustomPropertiesType();
                return _CustomProperties;
            }
            set
            {
                _CustomProperties = value;
            }
        }

        public string DataElementName
        {
            get
            {
                return _DataElementName;
            }
            set
            {
                _DataElementName = value;
            }
        }

        public ListTypeDataElementOutput DataElementOutput
        {
            get
            {
                return _DataElementOutput;
            }
            set
            {
                _DataElementOutput = value;
            }
        }

        public ListTypeDataInstanceElementOutput DataInstanceElementOutput
        {
            get
            {
                return _DataInstanceElementOutput;
            }
            set
            {
                _DataInstanceElementOutput = value;
            }
        }

        public string DataInstanceName
        {
            get
            {
                return _DataInstanceName;
            }
            set
            {
                _DataInstanceName = value;
            }
        }

        public string DataSetName
        {
            get
            {
                return _DataSetName;
            }
            set
            {
                _DataSetName = value;
            }
        }

        public Nullable<bool> FillPage
        {
            get
            {
                return _FillPage;
            }
            set
            {
                _FillPage = value;
            }
        }

        public FiltersType Filters
        {
            get
            {
                if (_Filters == null)
                    _Filters = new FiltersType();
                return _Filters;
            }
            set
            {
                _Filters = value;
            }
        }

        public GroupingType Grouping
        {
            get
            {
                if (_Grouping == null)
                    _Grouping = new GroupingType();
                return _Grouping;
            }
            set
            {
                _Grouping = value;
            }
        }

        public string Height
        {
            get
            {
                return _Height;
            }
            set
            {
                _Height = value;
            }
        }

        public Nullable<bool> KeepTogether
        {
            get
            {
                return _KeepTogether;
            }
            set
            {
                _KeepTogether = value;
            }
        }

        public string Label
        {
            get
            {
                return _Label;
            }
            set
            {
                _Label = value;
            }
        }

        public string Left
        {
            get
            {
                return _Left;
            }
            set
            {
                _Left = value;
            }
        }

        public string LinkToChild
        {
            get
            {
                return _LinkToChild;
            }
            set
            {
                _LinkToChild = value;
            }
        }

        public string Name
        {
            get
            {
                return nameField;
            }
            set
            {
                nameField = value;
            }
        }

        public string NoRows
        {
            get
            {
                return _NoRows;
            }
            set
            {
                _NoRows = value;
            }
        }

        public Nullable<bool> PageBreakAtEnd
        {
            get
            {
                return _PageBreakAtEnd;
            }
            set
            {
                _PageBreakAtEnd = value;
            }
        }

        public Nullable<bool> PageBreakAtStart
        {
            get
            {
                return _PageBreakAtStart;
            }
            set
            {
                _PageBreakAtStart = value;
            }
        }

        public string RepeatWith
        {
            get
            {
                return _RepeatWith;
            }
            set
            {
                _RepeatWith = value;
            }
        }

        public ReportItemsTypeComposite ReportItems
        {
            get
            {
                if (_ReportItems == null)
                    _ReportItems = new ReportItemsTypeComposite();
                return _ReportItems;
            }
            set
            {
                _ReportItems = value;
            }
        }

        public SortingType Sorting
        {
            get
            {
                if (_Sorting == null)
                    _Sorting = new SortingType();
                return _Sorting;
            }
            set
            {
                _Sorting = value;
            }
        }

        public StyleType Style
        {
            get
            {
                if (_Style == null)
                    _Style = new StyleType();
                return _Style;
            }
            set
            {
                _Style = value;
            }
        }

        public string ToolTip
        {
            get
            {
                return _ToolTip;
            }
            set
            {
                _ToolTip = value;
            }
        }

        public string Top
        {
            get
            {
                return _Top;
            }
            set
            {
                _Top = value;
            }
        }

        public VisibilityType Visibility
        {
            get
            {
                if (_Visibility == null)
                    _Visibility = new VisibilityType();
                return _Visibility;
            }
            set
            {
                _Visibility = value;
            }
        }

        public string Width
        {
            get
            {
                return _Width;
            }
            set
            {
                _Width = value;
            }
        }

        public Nullable<uint> ZIndex
        {
            get
            {
                return _ZIndex;
            }
            set
            {
                _ZIndex = value;
            }
        }

        public ListType()
        {
            _FillPage = new Nullable<bool>[]();
            _KeepTogether = new Nullable<bool>[]();
            _PageBreakAtEnd = new Nullable<bool>[]();
            _PageBreakAtStart = new Nullable<bool>[]();
            _ZIndex = new Nullable<uint>[]();
        }

        public ListType Write()
        {
            ListType listType = new ListType();
            ArrayList arrayList1 = new ArrayList();
            ArrayList arrayList2 = new ArrayList();
            listType.Name = nameField;
            if (_Action != null)
            {
                arrayList1.Add(_Action.Write());
                arrayList2.Add(1);
            }
            if (_Bookmark != null)
            {
                arrayList1.Add(_Bookmark);
                arrayList2.Add(2);
            }
            if (_CustomProperties != null)
            {
                arrayList1.Add(_CustomProperties.Write());
                arrayList2.Add(3);
            }
            if (_DataElementName != null)
            {
                arrayList1.Add(_DataElementName);
                arrayList2.Add(4);
            }
            arrayList1.Add(_DataElementOutput);
            arrayList2.Add(5);
            arrayList1.Add(_DataInstanceElementOutput);
            arrayList2.Add(6);
            if (_DataInstanceName != null)
            {
                arrayList1.Add(_DataInstanceName);
                arrayList2.Add(7);
            }
            if (_DataSetName != null)
            {
                arrayList1.Add(_DataSetName);
                arrayList2.Add(8);
            }
            if (_FillPage.get_HasValue())
            {
                arrayList1.Add(_FillPage);
                arrayList2.Add(9);
            }
            if (_Filters != null)
            {
                arrayList1.Add(_Filters.Write());
                arrayList2.Add(10);
            }
            if (_Grouping != null)
            {
                arrayList1.Add(_Grouping.Write());
                arrayList2.Add(11);
            }
            if (_Height != null)
            {
                arrayList1.Add(_Height);
                arrayList2.Add(12);
            }
            if (_KeepTogether.get_HasValue())
            {
                arrayList1.Add(_KeepTogether);
                arrayList2.Add(13);
            }
            if (_Label != null)
            {
                arrayList1.Add(_Label);
                arrayList2.Add(14);
            }
            if (_Left != null)
            {
                arrayList1.Add(_Left);
                arrayList2.Add(15);
            }
            if (_LinkToChild != null)
            {
                arrayList1.Add(_LinkToChild);
                arrayList2.Add(16);
            }
            if (_NoRows != null)
            {
                arrayList1.Add(_NoRows);
                arrayList2.Add(17);
            }
            if (_PageBreakAtEnd.get_HasValue())
            {
                arrayList1.Add(_PageBreakAtEnd);
                arrayList2.Add(18);
            }
            if (_PageBreakAtStart.get_HasValue())
            {
                arrayList1.Add(_PageBreakAtStart);
                arrayList2.Add(19);
            }
            if (_RepeatWith != null)
            {
                arrayList1.Add(_RepeatWith);
                arrayList2.Add(20);
            }
            if (_ReportItems != null)
            {
                arrayList1.Add(_ReportItems.Write());
                arrayList2.Add(21);
            }
            if (_Sorting != null)
            {
                arrayList1.Add(_Sorting.Write());
                arrayList2.Add(22);
            }
            if (_Style != null)
            {
                arrayList1.Add(_Style.Write());
                arrayList2.Add(23);
            }
            if (_ToolTip != null)
            {
                arrayList1.Add(_ToolTip);
                arrayList2.Add(24);
            }
            if (_Top != null)
            {
                arrayList1.Add(_Top);
                arrayList2.Add(25);
            }
            if (_Visibility != null)
            {
                arrayList1.Add(_Visibility.Write());
                arrayList2.Add(26);
            }
            if (_Width != null)
            {
                arrayList1.Add(_Width);
                arrayList2.Add(27);
            }
            if (_ZIndex.get_HasValue())
            {
                arrayList1.Add(_ZIndex);
                arrayList2.Add(28);
            }
            listType.Items = arrayList1.ToArray();
            listType.ItemsElementName = (ItemsChoiceType18[])arrayList2.ToArray(typeof(ItemsChoiceType18));
            arrayList2 = arrayList1 = null;
            return listType;
        }

    } // class ListType

}

